var Vue = require('vue');
import App from './App.vue'
var VueRouter = require('vue-router');
var VueResource = require('vue-resource');

Vue.use(VueRouter)
Vue.use(VueResource);
Vue.http.headers.common['X-CSRF-TOKEN'] = document.querySelector('#token').getAttribute('content');

var router = new VueRouter({
    // hashbang: false,
})

router.map({
    '/': {
        component: require('./components/Index.vue')
    },
    '/category': {
        name: 'category',
        component: require('./components/Categories.vue')
    },
    '/category/create': {
        name: 'category_create',
        component: require('./components/CategoryCreate.vue')
    },
    '/category/:categoryId/edit': {
        name: 'category_edit',
        component: require('./components/CategoryEdit.vue')
    }
})

router.start(App, '#app')